package com.ruicar.afs.cloud.afscase.channel.entity;

import com.alibaba.fastjson.annotation.JSONField;
import com.baomidou.mybatisplus.annotation.FieldStrategy;
import com.baomidou.mybatisplus.annotation.TableField;
import com.baomidou.mybatisplus.annotation.TableName;
import com.fasterxml.jackson.annotation.JsonFormat;
import com.fasterxml.jackson.databind.annotation.JsonSerialize;
import com.fasterxml.jackson.databind.ser.std.ToStringSerializer;
import com.ruicar.afs.cloud.common.core.entity.BaseEntity;
import io.swagger.annotations.ApiModel;
import lombok.Data;

import java.math.BigDecimal;
import java.util.Date;

/**
 * @author mingzhi.li
 * @date 2020年6月9日10:18:20
 */
@Data
@TableName("channel_quota_info")
@ApiModel(value = "额度信息信息表")
public class ChannelQuotaInfo extends BaseEntity<ChannelQuotaInfo> {
    /**
     * 渠道ID
     */
    @JsonSerialize(using= ToStringSerializer.class)
    @JSONField(serializeUsing = com.alibaba.fastjson.serializer.ToStringSerializer.class)
    private Long channelId;
    /**
     * 额度类型;签放额度；先放后抵额度
     */
    private String quotaType;
    /**
     * 签放额度调整
     */
    private BigDecimal quotaSigning;
    /**
     * 额度金额
     */
    private BigDecimal quotaAmount;
    /**
     * 临时额度
     */
    private BigDecimal tempQuota;
    /**
     * 有效期
     */
    @JsonFormat(pattern = "yyyy-MM-dd")
    @TableField(updateStrategy =  FieldStrategy.IGNORED)
    private Date validityTermEnd;
    /**
     * 占用额度
     */
    private BigDecimal occupiedQuota;
    /**
     * 剩余额度
     */
    private BigDecimal surplusQuota;
    /**
     * 是否控制额度
     */
    private String quotaControlSwitch;
    /**
     * 业务类型;newCar：新车 oldCar：二手车
     */
    private String businessType;

}
